package com.yan.factory.method.simple;

@SuppressWarnings("all")
public class OperationFactory {
    public static Operation newInstance(String op) {
        switch (op) {
            case "+":
                return new Add();
            case "-":
                return new Sub();
            case "*":
                return new Multi();
            case "/":
                return new Div();
            default:
                throw new IllegalArgumentException("Unknown Opration");
        }
    }
}
